package adapter;

import adaptee.EuropeanPowerSource;
import targetClass.USPowerSource;

// 适配器：电源适配器（对象适配器）
public class PowerAdapter implements USPowerSource {
    private EuropeanPowerSource europeanPowerSource;
    
    public PowerAdapter(EuropeanPowerSource europeanPowerSource) {
        this.europeanPowerSource = europeanPowerSource;
    }
    
    @Override
    public void providePower() {
        System.out.println("适配器工作：将欧洲电源转换为美国标准");
        europeanPowerSource.supplyPower();
        System.out.println("输出：提供110V美国标准电源");
    }
}